
const CHANNEL_KEY = 'add_search_history'
/**
 * 保存频道数据
 * @param channels
 */
export function setHistory (channels: string[]): void {
  localStorage.setItem(CHANNEL_KEY, JSON.stringify(channels))
}

/**
 * 获取频道列表数据
 * @returns
 */
export function getHistory (): string[] {
  return JSON.parse(localStorage.getItem(CHANNEL_KEY) || '{}')
}
